//Javascript for opening property pages
function wf_openpropertypage(propertypagename,propertyname,selectedactionname,windowopentags)
{	
	windowopentags += ",resizable=yes";	
	if(propertypagename == "workflowmemo")
		window.open ("<%#absolutepath%>?mode=new&propertypage=" + propertypagename + "&<%#SelectedItemQueryString%>&propertyname=" + propertyname +"",propertypagename,'height=350,width=650,resizable=yes');
	else
		window.open ("<%#absolutepath%>?mode=new&propertypage=" + propertypagename + "&<%#SelectedItemQueryString%>&propertyname=" + propertyname +"",propertypagename,windowopentags);
}

function OpenPropertyPages(opentype)
{

	switch (opentype) 
	{
	
	case "open":
		wf_openpropertypage('open','','','height=180,width=325,resizable=yes')
	break;
	case "rename":
		wf_openpropertypage('rename','','','height=180,width=325,resizable=yes')
	break;	
	case "saveas":
		wf_openpropertypage('saveas','','','height=180,width=325,resizable=yes')
	break;
	case "delete":
		wf_openpropertypage('delete','','','height=180,width=325,resizable=yes')
	break;
	case "export":
		location.href='?export=true'
	break;
	case "import":		
		wf_openpropertypage('import','','','height=180,width=325,resizable=yes')
	break;	
	case "opendeployed":		
		wf_openpropertypage('opendeployed','','','height=200,width=375,resizable=yes') 
	break;
	case "deploy":		
		wf_openpropertypage('deploy','','','height=200,width=325,resizable=yes')
	break;
	case "clear":		
		wf_openpropertypage('clear','','','height=170,width=340,resizable=yes')
	break;
	
	
	}
}
function mmLoadMenus() {
  if (window.mm_menu_0727171053_0) return;
  window.mm_menu_0727171053_0 = new Menu("root",100,25,"Verdana",10,"#000000","#000000","#E0E0E0","#C4D2FB","left","middle",3,0,1000,-5,7,true,true,true,0,false,false);
  mm_menu_0727171053_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/open-trans.png' align='left'> Open","'open'");
  mm_menu_0727171053_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/rename-trans.png' align='left'> Rename","'rename'");
  mm_menu_0727171053_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/saveas-trans.png' align='left'> Save&nbsp;As","'saveas'");
  mm_menu_0727171053_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/delete-trans.png' align='left'> Delete","'delete'");
  mm_menu_0727171053_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/clear-trans.png' align='left'> Clear","'clear'");
   mm_menu_0727171053_0.fontWeight="bold";
   mm_menu_0727171053_0.hideOnMouseOut=true;
   mm_menu_0727171053_0.bgColor='#555555';
   mm_menu_0727171053_0.menuBorder=1;
   mm_menu_0727171053_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0727171053_0.menuBorderBgColor='#889CD5';

  window.mm_menu_0728101127_0 = new Menu("root",130,25,"Verdana",10,"#000000","#000000","#E0E0E0","#C4D2FB","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0728101127_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/open-deployed-trans.png' align='left'> Open&nbsp;Deployed","'opendeployed'");
  mm_menu_0728101127_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/deploy-trans.png' align='left'> Deploy","'deploy'");
   mm_menu_0728101127_0.fontWeight="bold";
   mm_menu_0728101127_0.hideOnMouseOut=true;
   mm_menu_0728101127_0.bgColor='#555555';
   mm_menu_0728101127_0.menuBorder=1;
   mm_menu_0728101127_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0728101127_0.menuBorderBgColor='#889CD5';

  window.mm_menu_0728101229_0 = new Menu("root",100,25,"Verdana",10,"#000000","#000000","#E0E0E0","#C4D2FB","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0728101229_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/export-trans.png' align='left'> Import","'import'");
  mm_menu_0728101229_0.addMenuItem("<img src='<%#VirtualDirectory%>/Images/import-trans.png' align='left'> Export","'export'");
   mm_menu_0728101229_0.fontWeight="bold";
   mm_menu_0728101229_0.hideOnMouseOut=true;
   mm_menu_0728101229_0.bgColor='#555555';
   mm_menu_0728101229_0.menuBorder=1;
   mm_menu_0728101229_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0728101229_0.menuBorderBgColor='#889CD5';

mm_menu_0728101229_0.writeMenus();
}

//Javascript function for resizeing image
function wf_resizeimage(resizepercent)
{
	var obj = eval("imageframe<%#uniqueid%>");
	obj.wf_resizeimage(resizepercent);
}

//Javascript function for mantaining scroll state
function wf_scrollstate()
{
	var myframe = eval("imageframe<%#uniqueid%>");;
	if (myframe==null) 
		return;
	
	if(navigator.userAgent.indexOf("Netscape") >0 )
	{
		properties("_hidscrollleft",myframe.scrollX);
		properties("_hidscrolltop",myframe.scrollY);
	}
	else
	{
		properties("_hidscrollleft",myframe.document.body.scrollLeft);
		properties("_hidscrolltop",myframe.document.body.scrollTop);
	}
	return true;
}

// Javascript to getcontrolelement [Function getelement]
function getelement(elementname)
{
	var t;
	if(navigator.userAgent.indexOf("Netscape") >0 )
		document.all = document.getElementsByTagName("*");
	
	t = document.all[elementname];
	return t;
}

//Javascript function to submitform
function submitform()
{
	var t;
	if(navigator.userAgent.indexOf("Netscape") >0 )
			document.all = document.getElementsByTagName("*");
	
	t = document.all["_hidtempstore"];
	t.form.action = submitform.arguments[0];
	t.form.method = "POST";
	t.form.submit();
}


//"Javascript to set values for hidden variables [Function Properties]"	
function properties(propertyname,value)
{
	var t;
	if(navigator.userAgent.indexOf("Netscape") >0 )
		document.all = document.getElementsByTagName("*");
	
	t = document.all[propertyname];
	t.value = value;
}

//Show errors
function showerrors()
{
	alert(errortext);
}
function AddSplitterToQueryString(clickedsplitter)
{
	var url= location.href;
	var splitterDisplayValue;
	
	a = document.getElementById('LeftFrame');
	splitterDisplayValue = "LeftFrame;"+a.style.display
	
	a = document.getElementById('RightFrame');
	splitterDisplayValue += "@RightFrame;"+a.style.display
	
	urlArr = url.split('splitterdisplayvalue');
	if(url.indexOf('?splitterdisplayvalue') > 0 || url.indexOf('&splitterdisplayvalue') > 0)
		location.href= urlArr[0] +'splitterdisplayvalue='+splitterDisplayValue +'&clicksplittertype='+clickedsplitter
	else if(urlArr[0].indexOf('?') > 0 )
		location.href= urlArr[0] +'&splitterdisplayvalue='+splitterDisplayValue +'&clicksplittertype='+clickedsplitter
	else
		location.href= urlArr[0] +'?splitterdisplayvalue='+splitterDisplayValue +'&clicksplittertype='+clickedsplitter
}
//To hide and display elements
function toggle()
{
	a = document.getElementById('LeftFrame');
	if(a.style.display!="none")
	{
		document.images["splitterleft"].src = "<%#VirtualDirectory%>/images/splitter-left.gif";
	}
	else
	{
		document.images["splitterleft"].src = "<%#VirtualDirectory%>/images/splitter-right.gif";
	}
	a = document.getElementById('RightFrame');

	//When splitter is decreased
	if(a.style.display!="none")
	{
		document.images["splitterright"].src = "<%#VirtualDirectory%>/images/splitter-right.gif";
	}
	else
	{
		document.images["splitterright"].src = "<%#VirtualDirectory%>/images/splitter-left.gif";
	}
}